package com.xymtop.sqlcater.core.sql.sqlconnecter.builder;


import com.xymtop.sqlcater.core.sql.sqlconnecter.entity.SqlConfig;
import lombok.Data;

//数据库配置类构建
@Data
public class SqlConfigBuild {
    //数据库配置类
    private SqlConfig sqlConfig;


    public static SqlConfigBuild add(String driver,String url,String port,String username,String password,String database){
        SqlConfigBuild sqlConfigBuild = new SqlConfigBuild();
        SqlConfig config = new SqlConfig();
        config.setDriver(driver);
        config.setPort(port);
        config.setUrl(url);
        config.setUserName(username);
        config.setDataBase(database);
        config.setPassWord(password);
        sqlConfigBuild.setSqlConfig(config);
        return sqlConfigBuild;
    }

    public SqlConfig build(){
        return this.sqlConfig;
    }
}
